/*
 * Splash.java
 *
 * Created on 17 de Novembro de 2006, 17:41
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package jpianinho;

import javax.microedition.lcdui.*;
import java.io.*;
import java.util.*;

/**
 *
 * @author felix
 */
public class Splash extends Canvas implements CommandListener {
    private JPianinho parent;
    
    public void paint(Graphics g) {
        // get screen size
        int w = getWidth();
        int h = getHeight();
        
        // clear screen
        g.setColor(0xffffff);
        g.fillRect(0, 0, w, h);
        g.setColor(0x000000);
        
        // draw screen
        g.drawString("JPianinho 0.12",10,10,0);
        g.drawString("by Felix Farias",10,25,0);
        g.drawString("code.google.com",10,40,0);
        g.drawString("Licensed under GPL",10,55,0);
        //g.drawString("www.gnu.org/licenses",10,70,0);
    }    
    /** Creates a new instance of Splash */
    public Splash(JPianinho parent) {
        this.parent = parent;
        try {
            setCommandListener(this);
            addCommand(new Command("Start", Command.EXIT, 1));
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
    
    /** handles start command */
    public void commandAction(Command command, Displayable displayable) {
        parent.startPianinho();
    }
    
}
